package com.bey.bow.web.course;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.bey.bow.service.course.CourseDetailService;

@Controller
@RequestMapping(value = "courseDetail")
public class CourseDetailController {
	
	private CourseDetailService courseDetailService;
	
	@RequestMapping(value = "{id}", method = RequestMethod.GET)
	public String updateForm(@PathVariable("id") Long id, Model model) {
		model.addAttribute("courseDetail", courseDetailService.getCourseDetail(id));
		return "course/courseDetailView";
	}

	@Autowired
	public void setCourseDetailService(CourseDetailService courseDetailService) {
		this.courseDetailService = courseDetailService;
	}

	
}
